package me.firstapp.repository.bbs;

import me.firstapp.common.utils.Page;
import me.firstapp.module.bbs.Collection;
import me.firstapp.repository.base.EntityRepository;

public interface CollectionRepository extends EntityRepository<Collection> {

	/**
	 * 查询收藏量
	 * 
	 */
	Long findCollectionCounts(Long memberId, Long topicId, Long productId, Long apiClientId);

	/**
	 * 查询用户话题收藏关系
	 * 
	 * @param memberId
	 * @param topicId
	 */
	Collection findMemberTopicCollectionRel(Long memberId, Long topicId, Long apiClientId);

	/**
	 * 查询用户商品收藏关系
	 * 
	 * @param memberId
	 * @param productId
	 * @return
	 */
	Collection findMemberProductCollectionRel(Long memberId, Long productId, Long apiClientId);

	/**
	 * 分页查询用户收藏
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param memberId
	 */
	Page<Collection> findMemberCollectionsPage(Integer pageNo, Integer pageSize, Long memberId, Integer type, Long apiClientId);
}
